package com.roubsite.site.action;

import com.roubsite.site.bean.Demo;
import com.roubsite.web.action.RSAction;

import java.util.HashMap;
import java.util.Map;

public class IndexAction extends RSAction {
    @Override
    public void execute() throws Exception {
        Map m = new HashMap();
        m.put("A","这是一个Map的取值方式");
        //将Map作为一个Value放入到模板变量demoMap中
        this.assign("demoMap",m);

        Demo demo = new Demo();
        demo.setTest("Bean的取值方式");
        //将Bean作为一个Value放入到模板变量demoBean中
        this.assign("demoBean",demo);


        //放入一个纯文本变量“demoWord”到模板中
        this.assign("demoText","Hello World!");

        //输出模板
        this.display("index.html");
    }
}
